package com.ticket.system.service;

import java.math.BigDecimal;
import java.util.List;

import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.ticket.common.core.domain.AjaxResult;
import com.ticket.common.core.domain.model.LoginUser;
import com.ticket.system.domain.YanchuOrder;
import com.ticket.system.domain.YanchuSession;
import com.ticket.system.domain.vo.*;

import javax.servlet.http.HttpServletResponse;

/**
 * 订单Service接口
 * 
 * @author ruoyi
 * @date 2023-09-26
 */
public interface IYanchuOrderService 
{
    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    public OrderVo selectYanchuOrderById(Long id);

    public DetailInfoVO getDetailInfo(String orderId);

    public TicketInfoVO getTicketDetail(String orderId);

    public YanchuOrder selectOrderById(Long id);

    public YanchuOrder selectOrderPayByOrderNo(String id) throws WxPayException;

    public OrderVo selectOrderVoById(Long id);

    /**
     * 查询订单列表
     * 
     * @param yanchuOrder 订单
     * @return 订单集合
     */
    public List<YanchuOrder> selectYanchuOrderList(YanchuOrder yanchuOrder);

    public List<YanchuOrderVO> selectOrderList(QueryOrderListVO query);


    public List<OrderVo> selectUserOrderVoList(YanchuOrder yanchuOrder);

    /**
     * 新增订单
     * 
     * @param orderVo 订单
     * @return 结果
     */
    public AjaxResult insertYanchuOrder(OrderParamVo orderVo,YanchuSession yanchuSession) throws WxPayException;

    public AjaxResult insertNoPayYanchuOrder(OrderParamVo orderVo,YanchuSession yanchuSession);

    /**
     * 新增出票
     * @param orderVo
     * @param yanchuSession
     * @return
     */
    public AjaxResult insertYanchuBackendOrder(OrderParamVo orderVo, YanchuSession yanchuSession);

    public YanchuOrder notifyOrder(String outTradeNo, BigDecimal totalFee,String transactionId,YanchuOrder yanchuOrder);
    /**
     * 修改订单
     * 
     * @param yanchuOrder 订单
     * @return 结果
     */
    public int updateYanchuOrder(YanchuOrder yanchuOrder);

    public int payYanchuOrder(OrderPayParamVo orderPayParamVo);

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键集合
     * @return 结果
     */
    public int deleteYanchuOrderByIds(Long[] ids);

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    public int deleteYanchuOrderById(Long id);

    public void closeExpireOrder();

    /**
     * (管控台)查询订单列表
     *
     * @return 订单集合
     */
    public List<OrderVo> selectYanchuOrderPageList(Long deptId,Long performId,Long sessionId,
                                                   Integer orderStatus, String orderId,String ticketBuyer,
                                                   String phone);

    /**
     * 场次是否全部退款
     *
     * @param sessionId
     * @return
     */
    Boolean checkOrderStatus(Long sessionId);

    public int releaseOrder(YanchuOrder yanchuOrder);

    public int cancelOrder(Long orderId);

    OrderStatisticsVO getOrderStatisticsVO(QueryOrderListVO queryOrderListVO);

    void exportOrderStatistics(HttpServletResponse response, QueryOrderListVO query);

    void exportOrderList(HttpServletResponse response, QueryOrderListVO query);

    Integer getExportCount(QueryOrderListVO query);

    WxPayMpOrderResult unifiedOrder(YanchuOrder yanchuOrder, LoginUser loginUser,String notifyPayUrl,String body) throws WxPayException;

}
